package j07object;

public class J1 {
    public static void main(String[] args) {
        Object object = new Object();
        System.out.println(object.toString());//16
        System.out.println(object.hashCode());//10
        System.out.println(0x4554617c);//1163157884

        object = null;
        // 垃圾回收车 线程
        // 智能，
        System.gc();//呼唤垃圾车
    }
}

class Cat{
    @Override
    protected void finalize() throws Throwable {
        System.out.println("垃圾车来了！");
    }
}
class CatTest{
    public static void main(String[] args) {
        Cat cat = new Cat();
        cat = null;
        System.out.println(1111);
        System.gc();
        System.out.println(2);
        System.out.println(3);
        System.out.println(4);
        System.out.println(5);
        System.out.println(6);
        System.out.println(7);
        System.out.println(7);
        System.out.println(7);
        System.out.println(7);
        System.out.println(7);
        System.out.println(7);
        System.out.println(7);
        System.out.println(7);
    }
}

class SystemTest{
    public static void main(String[] args) {
        long old = System.currentTimeMillis();
        int num = 0;
        for (int i = 0; i < 1000; i++) {
            num++;
            System.out.println(num);
        }
        long now = System.currentTimeMillis();
        System.out.println(now-old);
    }
}